"use client";
import { LeftListClient, WheelClient } from "@/components/Box/WheelModal";
import dayjs from "dayjs";
import { useSearchParams } from "next/navigation";
import { useEffect } from "react";

const Page = () => {
    const r = useSearchParams();

    const time =
        dayjs(Number(r.get("time")) * 1000)
            .subtract(3, "days")
            .valueOf() / 1000;

    useEffect(() => {
        sessionStorage.setItem("turntable_id", r.get("turntable") || "");
        sessionStorage.setItem("turntable_user_id", r.get("user") || "");
        sessionStorage.setItem("turntable_time", `${time}` || "");
    }, []);
    return (
        <div className={"transform"}>
            <WheelClient isRotate={false} wheel={{}} />
            <div className={"mt-[10px] h-[1.6rem] overflow-hidden p-[0.1389rem]"}>
                <LeftListClient />
            </div>
        </div>
    );
};

export default Page;
